type Tags = {
    Origin: boolean;
    Outlined: boolean;
    Round: boolean;
    Sharp: boolean;
    TwoTone: boolean;
};
export type IconInput = Partial<Tags>;
const cache: IconInput = {};
/**
 * 获取 GoogleIcon 字体样式的载入
 * @param total
 */
export const useIcon = (total: IconInput = { Origin: true }) => {
    FontList.filter(({ tag }) => {
        const Tag = tag as keyof Tags;
        return total[Tag] && !cache[Tag];
    }).forEach(({ fontFamily, tag }) => {
        const Tag = tag as keyof Tags;
        const link = document.createElement("link");
        link.href = `https://fonts.googleapis.com/css2?family=${fontFamily.replace(
            /\s/g,
            "+"
        )}`;
        link.rel = "stylesheet";
        document.body.appendChild(link);
        cache[Tag] = true;
    });
};
export const FontList = [
    { fontFamily: "Material Icons", tag: "Origin" },
    { fontFamily: "Material Icons Outlined", tag: "Outlined" },
    { fontFamily: "Material Icons Round", tag: "Round" },
    { fontFamily: "Material Icons Sharp", tag: "Sharp" },
    { fontFamily: "Material Icons Two Tone", tag: "TwoTone" },
] as {
    fontFamily: string;
    tag: keyof IconInput;
}[];
